home *** CD-ROM | disk | FTP | other *** search
- Path: shellx.best.com!usenet
- From: Remi Lenoir <remi@dvsystems.com>
- Newsgroups: comp.sys.amiga.networking
- Subject: Re: trying to kludge an lp
- Date: Sun, 04 Feb 1996 21:38:03 -0800
- Organization: Digital Video Systems
- Message-ID: <311597BB.3019@dvsystems.com>
- References: <DM2sBF.9su@muse.calarts.edu> <31122BFD.2030@gbar.dtu.dk> <19960204.73EFD40.9B22@ragtime.vnet.net>
- NNTP-Posting-Host: pepper.vip.best.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (Win95; I)
-
- John Kelly wrote:
- >
- > Rask Ingemann Lambertsen <gc948374@gbar.dtu.dk> writes:
- >
- > > > The best thing I can think of is to intercept stuff on it's way
- > > > to PRT: and remote copy (rcp) it to the prt: device of the node that has
- > > > the printer. Is there a way to do this? anyone have better ideas?
- > >
- > > Try the CMD command that comes with your WB, it can intercept output to
- > > serial or parallel devices and redirect it to a file.
- >
- > Or lpd.lha, which is a line printer daemon for AmiTCP, and does exactly
- > what he wants.
- >
- > comm/tcp/ on any Aminet site.
-
- This will be the first step: make the printer available to the network. But then, how to
- *transparently* print from the Amiga applications ?
-
- To my knowledge there is no DOS handler or device driver to print with AmiTCP or AS225.
- It would be nice to have a NETPRT: device to which we could copy files. It would also be
- nice to have a PRT:/printer.device redirector to NETPRT: as well as one that would allow
- the files to be automatically processed -by a user specified program- just before they
- get sent to the network (processed by 'a2p' for example...).
-
- I personaly do not have the first problem as on our network the printer is made available
- by the server (SUN station). But, as john suggests, you could try lpd.lha to make the
- printer available to your network.
-
- As for the second problem, I wrote an AREXX script for Final Writer that do the following:
- 1 - Captures the data sent by FW using CMD.
- 2 - Copy the data to the my account on the SUN server (accessible through NFS).
- 3 - Issue a "lpr" on the SUN ("rsh lpr filename")
- 4 - Delete the file from my account on the SUN.
-
- It works ok but is not perfect because of bugs/limitations in FW1's AREXX interface.
-
- Also, there is a lpr client that I use when printing text/postscript files from the SHELL.
- It is called port-lpr and is available on Aminet in comm/tcp as port-lpr.lha.
-
- I have included the two AREXX scripts. Feel free to modify them to suit your needs.
- The two scripts are called from the user menu in FW. "NetPrint" print all the pages from
- the current section one by one. "NetPrint.All" attemps to print all the pages from all
- the sections but it doesn't work if I remember correctly (I didn't use those scripts for
- sometime).
-
- Regards,
-
- -Remi.
-
-
- ----------------------------------- NetPrint ----------------------------------------
-
- /***************************************************************/
- /* */
- /* BigNetPrint */
- /* */
- /* A FinalWriter Arexx macro to print on a NetWorked Printer */
- /* */
- /* It uses the CMD program (SYS:Tools/CMD) to redirect the */
- /* output to RAM:, then copy the file to the networked server */
- /* and ask the server to print it. */
- /* */
- /* This is a modified version of NetPrint. The difference is */
- /* that large document are printed page by page in order to */
- /* keep the output files size in a reasonable proportion. */
- /* Large files are a problem for at least two reasons: */
- /* - Use a lot of RAM or Disk space */
- /* - Will cause you trouble with Unix spooler that will not */
- /* want to duplicate the file in its spool area because */
- /* it is too big (you'll have to ask him to use directly */
- /* the file on your account) */
- /* As a consequence, this method parallelizes the printing */
- /* process (While FinalWriter outputs a page, the printer */
- /* server prints a previous one) thus speeding the printing. */
- /* */
- /* Author: Remi Lenoir */
- /* Created: June 20, 1994 */
- /* */
- /***************************************************************/
-
- OPTIONS results
-
- /* These lines left just as examples */
- /*
- toto=4
- i=5
- PRINTSETUP Pages range frompage i topage i
- SHOWMESSAGE 1 1 '"toto = 'toto'" "" "" "OK" "" ""'
- EXIT
- */
-
- /* Print the document page by page */
- STATUS Pages
- NbrPage=result
- DO i=1 TO NbrPage
-
- /*
- Start 'CMD'.
- If it is already running then we can not print because we need to choose
- the output file name as we have to use copy it to the network.
- */
- IF SHOW(ports,'cas_TMP_CMD_PORT') THEN DO
- SHOWMESSAGE 1 1 '"CMD already running, Can not print!" "" "" "OK" "" ""'
- EXIT 5
- END
- ADDRESS COMMAND 'Run SYS:Tools/CMD parallel RAM:FinalWriter.prt'
- ADDRESS COMMAND 'SYS:rexxc/WaitForPort cas_TMP_CMD_PORT'
- IF (rc = 5) THEN DO
- SHOWMESSAGE 1 1 '"Can t start SYS:Tools/CMD !" "" "" "OK" "" ""'
- EXIT 5
- END
-
- /*
- Tell FinalWriter we want to print in range mode
- */
- PRINTSETUP Pages range frompage i topage i
-
- /*
- Print page i
- */
- PRINT
-
- /*
- Copy the file to my SparcStation account
- */
- ADDRESS COMMAND 'Copy RAM:FinalWriter.prt Sparc:'
-
- /*
- Delete the file from RAM:
- */
- ADDRESS COMMAND 'Delete RAM:FinalWriter.prt'
-
- /*
- Ask the SparcStation to print the file
- */
- ADDRESS COMMAND 'rsh dvs lpr -h FinalWriter.prt'
-
- /*
- Delete the file from my account
- (We can delete the file safely as Unix made a copy in its spool area)
- Note: if the file is too big, Unix will NOT make a copy and will print
- it directly. I do not handle that case, shame on me.
- */
- ADDRESS COMMAND 'Delete Sparc:FinalWriter.prt'
-
- END
-
-
- -------------------------------- NetPrint.All ----------------------------------
-
- /* Print All the section from the current document */
- OPTIONS results
-
- /*ADDRESS FinalW.1*/
-
- GetSectionList ','
- SectionList = Result
-
- DO WHILE SectionList ~= ''
- PARSE VAR SectionList SectionName ',' SectionList
- CALL NetPrint_test(SectionName)
- END
-
- EXIT 0
-